package com.itheima.test;

/**
 * @Author 王加鑫
 * @Date 2021/4/17 9:33
 * @Version 1.0
 * 强制类型转换
 */
public class VariableTest01 {
    public static void main(String[] args) {
        test1();
        test2();
        test3();

    }

    public static void test1(){
        int a = 10;
        byte b1 = 5;
        byte b2 = (byte)(b1+a);
        System.out.println("b2:"+b2);
        int i = a+b1;
        System.out.println("i:"+i);
    }

    public static void test2(){
        byte b3 = (byte)128;
        short s = 128;
        int  num = 128;
        System.out.println("b3:"+b3);
        System.out.println("s:"+s);
        System.out.println("num:"+num);
    }

    public static void test3(){
        byte b4 = 1+2+3;
        System.out.println("b4:"+b4);
    }
}
